package com.lhkj.ct.meta.modules.gauge.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lhkj.ct.meta.modules.gauge.model.entity.TblScaleSet;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Collection;
import java.util.Set;

/**
 * <p>
 * 测验组套 Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2023-11-01
 */
public interface ScaleSetMapper extends BaseMapper<TblScaleSet> {

    /**
     * 测验组套 - 分页
     */
    IPage<TblScaleSet> selectPages(Page<TblScaleSet> page,
                                   @Param("scaleSet") TblScaleSet scaleSet);

    /**
     * 测验组套 - 分页
     */
    IPage<TblScaleSet> selectPagesByAllot(Page<TblScaleSet> page,
                                   @Param("scaleSet") TblScaleSet scaleSet);

    @Select("select ifnull(max(sort) + 1, 1) from tbl_scale_set")
    Integer selectMaxSort();

    /**
     * 通过组套查询量表id
     */
    Set<String> selectByCombs(@Param("ids") Collection<String> ids);

}
